package com.gp.billsrecord.model.data

import androidx.room.Entity
import androidx.room.Ignore
import androidx.room.PrimaryKey
import com.gp.billsrecord.base.IComparator

/**
 * 流水信息
 */
@Entity(tableName = "tbl_bill_flow")
data class BillFlowInfo(
    /**
     * 消费金额
     */
    val money: Long,
    /**
     * 剩余金额
     * 数据库中不做存储
     */
    val remainMoney: Long,
    /**
     * 消费类型
     */
    val typeId: Long,
    /**
     * 消费类型名称
     */
    val type: String,
    val accountId: Long,
    val accountNumber: String,
    val accountType: String,
    /**
     * 备注
     */
    val mark: String = "",
    /**
     * 创建时间
     */
    val createTime: Long,
    /**
     *是否收入
     */
    val isIncome: Boolean = false,
    @PrimaryKey
    var flowId: Long = 0L,
    /**流水所属用户ID*/
    var userId: Long = 0L
) : IComparator<BillFlowInfo> {
    override fun areItemsTheSame(newItem: BillFlowInfo): Boolean = flowId == newItem.flowId

    override fun areContentsTheSame(newItem: BillFlowInfo): Boolean = flowId == newItem.flowId
}
